<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: XSend.php 289 2008-11-14 05:34:40Z steen.rabol@gmail.com $
 * @package Pradoportal.Common.XSend
 *
 */

	include_once("XMimeMail.php");
	$debug = true;
	$html_file = "./emailfile.html";
	$txt_file = "./emailfile.txt";
	$handle = fopen($html_file, "r");
	$html_content = fread ($handle, filesize ($html_file));
	fclose($handle);
	$handle = fopen($txt_file, "r");
	$txt_content = fread ($handle, filesize ($txt_file));
	fclose($handle);
		
	$email_obj = new XMimeMail();
	$email_obj->setCharset('iso-8859-1');
	$email_obj->setHtmlBody($html_content, $txt_content, "./");
	$email_params = array();
	$email_params['html_encoding'] = 'quoted-printable';
	$email_params['text_encoding'] = 'quoted-printable';
	$email_params['text_wrap'] = 998;
	$email_obj->prepare($email_params);
	
	$subject = "XMimeMail Test";
	
	// send email through the php Mail function
	$email_obj->send("User Name", "username@somewhere.net", "Sender Name", "sender@elsewhere.net", $subject);
	// open the smtp connection
	$email_obj->openStmp('smtp.anywhere.net', 'localhost', 'login@smtp.anywhere.net', 'password@smtp.anywhere.net');
	// send email through the smtp server
	$email_obj->sendSmtp("User Name", "username@somewhere.net", "Sender Name", "sender@elsewhere.net", $subject);
	// close the smtp connection
	$email_obj->closeSmtp();

	unset($email_obj);

?>
